Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serssion, server: fix the correctness of the query field in the DDL job (#15435) #15444

Merged
merged 3 commits into from
Mar 24, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Mar 18, 2020

cherry-pick #15435 to release-3.1


What problem does this PR solve?

Problem Summary:

	_, err = tk.Se.Execute(context.Background(), "show create table t")
	id, _, _, err := tk.Se.PrepareStmt("CREATE TABLE t2(id bigint PRIMARY KEY, age int)")
	...

	// Before this PR, this DDL job's Query is "show create table t".
	// After this PR,  this DDL job's Query is "CREATE TABLE t2(id bigint PRIMARY KEY, age int)".
	_, err = tk.Se.ExecutePreparedStmt(context.Background(), id, params)

If the DDL job's Query field is wrong, the binlog content will be wrong. We don't set the value of sessionctx.QueryString in ExecutePreparedStmt.

What is changed and how it works?

What's Changed: ExecutePreparedStmt will also be set to the value of sessionctx.QueryString.

Check List

Tests

  • Unit test

Release note

Fix the correctness of the query field in the DDL job

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 18, 2020

/run-all-tests

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

wjhuang2016
wjhuang2016 previously approved these changes Mar 18, 2020
Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Mar 24, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 24, 2020

Your auto merge job has been accepted, waiting for 15443

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 24, 2020

/run-all-tests

@zimulala
Copy link
Contributor

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 24, 2020

/run-all-tests

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimulala zimulala merged commit 31c7959 into pingcap:release-3.1 Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug. type/3.1-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants